load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "logical",
    srcs = [
        "create_logical_replication_stmt.go",
        "dead_letter_queue.go",
        "logical_replication_dist.go",
        "logical_replication_job.go",
        "logical_replication_writer_processor.go",
        "lww_kv_processor.go",
        "lww_row_processor.go",
        "metrics.go",
        "purgatory.go",
        "udf_row_processor.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/ccl/crosscluster/logical",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/ccl/changefeedccl/cdcevent",
        "//pkg/ccl/changefeedccl/changefeedbase",
        "//pkg/ccl/crosscluster",
        "//pkg/ccl/crosscluster/physical",
        "//pkg/ccl/crosscluster/streamclient",
        "//pkg/ccl/utilccl",
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/jobs/jobsprofiler",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/repstream/streampb",
        "//pkg/roachpb",
        "//pkg/server/telemetry",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/resolver",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/execinfra",
        "//pkg/sql/execinfrapb",
        "//pkg/sql/exprutil",
        "//pkg/sql/isql",
        "//pkg/sql/lexbase",
        "//pkg/sql/parser",
        "//pkg/sql/parser/statements",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/pgwire/pgerror",
        "//pkg/sql/physicalplan",
        "//pkg/sql/privilege",
        "//pkg/sql/row",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowexec",
        "//pkg/sql/sem/asof",
        "//pkg/sql/sem/catconstants",
        "//pkg/sql/sem/catid",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondata",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/syntheticprivilege",
        "//pkg/sql/types",
        "//pkg/util/admission/admissionpb",
        "//pkg/util/ctxgroup",
        "//pkg/util/hlc",
        "//pkg/util/log",
        "//pkg/util/log/logcrash",
        "//pkg/util/metamorphic",
        "//pkg/util/metric",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/span",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_errors//issuelink",
        "@com_github_cockroachdb_logtags//:logtags",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_lib_pq//oid",
    ],
)

go_test(
    name = "logical_test",
    srcs = [
        "dead_letter_queue_test.go",
        "logical_replication_job_test.go",
        "lww_row_processor_test.go",
        "main_test.go",
        "purgatory_test.go",
        "udf_row_processor_test.go",
    ],
    data = ["//c-deps:libgeos"],
    embed = [":logical"],
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/changefeedccl/cdcevent",
        "//pkg/ccl/changefeedccl/cdctest",
        "//pkg/ccl/changefeedccl/changefeedbase",
        "//pkg/ccl/crosscluster/replicationtestutils",
        "//pkg/ccl/crosscluster/replicationutils",
        "//pkg/ccl/crosscluster/streamclient",
        "//pkg/ccl/crosscluster/streamclient/randclient",
        "//pkg/ccl/storageccl",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/repstream/streampb",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/execinfra",
        "//pkg/sql/isql",
        "//pkg/sql/randgen",
        "//pkg/sql/rowenc",
        "//pkg/sql/sem/tree",
        "//pkg/testutils",
        "//pkg/testutils/jobutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/allstacks",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/metric",
        "//pkg/util/protoutil",
        "//pkg/util/randutil",
        "//pkg/util/retry",
        "//pkg/util/span",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//:pq",
        "@com_github_stretchr_testify//require",
    ],
)
